<script type="text/javascript">
  function validate()
  {
    var oHobbies = document.getElementsByName('hobbies[]');
    var count = 0;
    //alert(oHobbies.length)
    for ($i = 0; $i < oHobbies.length; $i++)
    {
      if(oHobbies[$i].checked == true){
        count++;
      }
    }
    if(count < 3){
      alert("Please check atleast 3 checkbox");
      return false;
    }
    return true;
  }

</script>

<form action="" name="register" onSubmit="return validate()" method="get">

  <input type="checkbox" name="hobbies[]" />
  Cricket<br>
  <input type="checkbox" name="hobbies[]" />
  Cricket<br>
  <input type="checkbox" name="hobbies[]" />
  Cricket<br>
  <input type="checkbox" name="hobbies[]" />
  Cricket<br>
  <input type="checkbox" name="hobbies[]" />
  Cricket<br>

  <input type="submit" value="I am done!!" />
</form>
